package org.study.event.core.transaction;

import org.study.event.core.common.EventMessage;
import org.study.event.core.transaction.handler.TransactionalEventHandler;

/***
 * 抽象处理类
 * 
 * @author 陈波
 *
 */
public abstract class AbstractTranactionListenerManager implements TranactionListenerManager {

	/***
	 * 处理事务消息
	 */
	protected TransactionalEventHandler transactionalEventHandler;

	public void setTransactionalEventHandler(TransactionalEventHandler transactionalEventHandler) {
		this.transactionalEventHandler = transactionalEventHandler;
	}

	
	@Override
	public void afterCommit(EventMessage message) {
		transactionalEventHandler.afterCommitHandle(message);
	}

	@Override
	public void afterRollBack(EventMessage message) {
		transactionalEventHandler.afterRollBackHandle(message);
	}

	@Override
	public void beforeCommit(EventMessage message) {
		transactionalEventHandler.beforeCommitHandle(message);
	}

	@Override
	public void afterCommpetion(EventMessage message) {
		transactionalEventHandler.afterCommptionHandle(message);
	}

}
